.ripple-box:rtl { border-radius: 0 0 0 52px; } // just a simple change to the border radius position
+// Rubberband for select-area screenshots
+.select-area-rubberband {
+ background-color: transparentize($selected_bg_color,0.7);
+ border: 1px solid $selected_bg_color;
+}
+
// not really top bar only
.popup-menu-arrow { icon-size: 1.09em; }
.popup-menu-icon { icon-size: 1.09em; }
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
-const { Clutter, Gio, GLib, Gtk, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const GrabHelper = imports.ui.grabHelper;
this._lastY = 0;
this._result = null;
- this._initRubberbandColors();
-
this._group = new St.Widget({ visible: false,
reactive: true,
x: 0,
coordinate: Clutter.BindCoordinate.ALL });
this._group.add_constraint(constraint);
- this._rubberband = new Clutter.Rectangle({ color: this._background,
- has_border: true,
- border_width: 1,
- border_color: this._border });
+ this._rubberband = new St.Widget({
+ style_class: 'select-area-rubberband',
+ visible: false
+ });
this._group.add_actor(this._rubberband);
}
this._group.visible = true;
}
- _initRubberbandColors() {
- function colorFromRGBA(rgba) {
- return new Clutter.Color({ red: rgba.red * 255,
- green: rgba.green * 255,
- blue: rgba.blue * 255,
- alpha: rgba.alpha * 255 });
- }
-
- let path = new Gtk.WidgetPath();
- path.append_type(Gtk.IconView);
-
- let context = new Gtk.StyleContext();
- context.set_path(path);
- context.add_class('rubberband');
-
- this._background = colorFromRGBA(context.get_background_color(Gtk.StateFlags.NORMAL));
- this._border = colorFromRGBA(context.get_border_color(Gtk.StateFlags.NORMAL));
- }
-
_getGeometry() {
return { x: Math.min(this._startX, this._lastX),
y: Math.min(this._startY, this._lastY),
this._rubberband.set_position(geometry.x, geometry.y);
this._rubberband.set_size(geometry.width, geometry.height);
+ this._rubberband.show();
return Clutter.EVENT_PROPAGATE;
}